//
//  GiftBtn.m
//  DataSource
//
//  Created by shuihulu02 on 2016/11/29.
//  Copyright © 2016年 大兵布莱恩特. All rights reserved.
//

#import "GiftBtn.h"

@implementation GiftBtn

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        self.imageViews = [[UIImageView alloc] init];
        
        self.imageViews.clipsToBounds = YES;
        self.imageViews.contentMode = UIViewContentModeScaleAspectFit;
        self.imageViews.autoresizingMask = UIViewAutoresizingFlexibleWidth;
        [self.imageViews setContentScaleFactor:[[UIScreen mainScreen] scale]];

        //        self.imageViews.backgroundColor = [UIColor lightGrayColor];
        [self addSubview:self.imageViews];
        self.imageLab = [[UILabel alloc] init];
        self.imageLab.textAlignment = NSTextAlignmentCenter;
        self.imageLab.font = [UIFont systemFontOfSize:11];
        self.imageLab.textColor = [UIColor whiteColor];
        self.priceLab = [[UILabel alloc] init];
        self.priceLab.textAlignment = NSTextAlignmentCenter;
        self.priceLab.font = [UIFont systemFontOfSize:10];
        self.priceLab.textColor = [UIColor lightGrayColor];
        [self addSubview:self.imageLab];
        
        [self addSubview:self.priceLab];
        self.selecImage = [[UIImageView alloc] init];
        [self addSubview:self.selecImage];
        
    }
    return self;
}

- (void)layoutSubviews
{
    [self.imageViews setFrame:CGRectMake(10, 5, self.bounds.size.width - 20, 65 )];
    [self.imageLab setFrame:CGRectMake(0, 75, self.frame.size.width, 10)];
    [self.priceLab setFrame:CGRectMake(0, 90, self.frame.size.width, 10)];
    
    [self.selecImage setFrame:CGRectMake(0, 0, SCREEN_WIDTH/4, self.frame.size.height)];
    
}

@end
